import config.AppConfig;
import gui.MainPage;
import network.websocket.WSClient;
import util.DialogHelper;

public class ClientMain {
    public static void main(String[] args) {
        try {
            AppConfig.initConfig();
            if ("".equals(AppConfig.getServerUrl())) {
                DialogHelper.showFailDialog("服务器地址为空\n" +
                        "请在配置文件./res/config.ini中配置服务器地址");
                System.exit(0);
            }
            WSClient.Instance.startConnect();
            WSClient.Instance.startAutoConnectListener();
            new MainPage();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
